package org.huawei260.TiKu.ODsuanfa;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
public class E_2024E_3254__固定滑窗_补种未成活胡杨 {

//	public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);

			int n = sc.nextInt();
			int m = sc.nextInt();

			int[] arr = new int[n];
			Arrays.fill(arr, 1);

			for (int i = 0; i < m; i++) {
				int deadIdx = sc.nextInt() - 1;
				arr[deadIdx] = 0;
			}

			int k = sc.nextInt();

			System.out.println(getResult(arr, k));
		}

		public static int getResult(int[] arr, int k) {
			int left = 0;
			LinkedList<Integer> occur = new LinkedList<>();
			int maxLen = 0;

			for (int right = 0; right < arr.length; right++) {
				if (arr[right] == 0) {
					occur.addLast(right);

					if (occur.size() > k) {
						maxLen = Math.max(maxLen, right - left);
						left = occur.removeFirst() + 1;
						continue;
					}
				}
				maxLen = Math.max(maxLen, right - left + 1);
			}
			return maxLen;
		}
	}